package com.fanrenqiji.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

/**
 * Created by yanwt on 2017/3/13.
 */
@Getter
@Setter
@Entity
@Table(name = "tb_message_template")
@org.hibernate.annotations.Table(appliesTo = "tb_message_template", comment = "课程留言板")
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate
@org.hibernate.annotations.Cache(region="message_template", usage = CacheConcurrencyStrategy.READ_WRITE)
public class MessageTemplateEntity extends DataEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(columnDefinition = ("varchar(200) default null comment '模板名称'"))
    private String name;

    @Column(name = "type", columnDefinition = ("int(1) not null comment '类型 0:短信，1:微信'"))
    private int type;

    @Column(name = "editable", columnDefinition = ("int(1) not null comment '是否允许修改 0:否，1:是'"))
    private int editable;

    @Column(name = "receive", columnDefinition = ("int(1) not null comment '接收人 0:全部 1:家长，2:老师，3:销售，4:分公司'"))
    private int receive;

    @Column(name = "status", columnDefinition = ("int(1) not null comment '状态 0:新建，1:发布'"))
    private int status;

    @Column(name = "wechat_template_id", columnDefinition = "varchar(60) default null comment '微信模板ID'")
    private String weChatTemplateId;

    @Column(name = "template_content", columnDefinition = "text not null comment '模板内容'")
    private String templateContent;

    @Column(name = "template_example", columnDefinition = "text not null comment '模板示例'")
    private String templateExample;

    @Column(name = "area_id", columnDefinition = ("bigint(20) not null comment '地区ID 根据用户所在区域设置短信通知内容'"))
    private Long areaId;

    @Column(columnDefinition = ("varchar(200) default null comment '链接地址'"))
    private String url;

    @Column(name = "attribute_name",columnDefinition = ("varchar(50) default null comment '自定义属性名'"))
    private String attributeName;

    @Column(name = "attribute_value",columnDefinition = ("varchar(255) default null comment '自定义属性值'"))
    private String attributeValue;

}
